import { runApp, IAppConfig } from 'ice';

const appConfig: IAppConfig = {
  app: {
    rootId: 'root',
    ErrorBoundaryFallback: function () {
      return <div>错误</div>;
    },
    getInitialData: async (ctx) => {},
  },
  router: {
    type: 'hash',
  },
  request: {
    baseURL: '',
    timeout: 1000,
    withCredentials: true,
    responseType: 'json',
    method: 'POST',
    interceptors: {
      request: {
        onConfig: async (config) => {
          return config;
        },
        onError: async (error) => {},
      },
      response: {
        onConfig: async (config) => {
          return config;
        },
        onError: async (error) => {},
      },
    },
  },
};

runApp(appConfig);
